home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / mui / MCC_TableGroup.lha / MCC_TableGroup / Developer / Cluster / txt / MCCTableGroup.def < prev    next >
Text File  |  1999-01-12  |  8KB  |  174 lines

  1. |##########|
  2. |#MAGIC   #|FLJDMNFE
  3. |#PROJECT #|"MCCTableGroupLib"
  4. |#PATHS   #|"StdProject"
  5. |#LINK    #|""
  6. |#GUIDE   #|""
  7. |#STACK   #|"4096"
  8. |#FLAGS   #|xx-x-x-xxxx--xx-----------------
  9. |#USERSW  #|--------------------------------
  10. |#USERMASK#|--------------------------------
  11. |#SWITCHES#|x----xxxxx-xx---
  12. |##########|
  13. DEFINITION MODULE MCCTableGroup;
  14.  
  15. (*------------------------------------------
  16.  
  17.   :Module.      MCCTableGroup.mod
  18.   :Author.      Henning Thielemann
  19.   :Address.     Veilchenweg 34, 06118 Halle, Germany
  20.   :EMail.       henning.thielemann@student.uni-halle.de
  21.   :Version.     $VER: MCCTableGroup.mod 1.0 (06.01.98)
  22.   :Copyright.   Henning Thielemann
  23.   :Language.    Cluster
  24.   :Translator.  Amiga Cluster V2.0
  25.   :Contents.    Advanced column/row group
  26.   :Usage.       See MCCTableDemo.mod
  27.   :History.            [ht]  25-Feb-1998 : NIL-dereferences in a sub-module prevented
  28.   :History.            [ht]  19-Feb-1998 : TableGroup sometimes forgot to dispose objects, fixed
  29.   :History.     0.1    [ht]  06-Jan-1998 : initial definition
  30.  
  31. --------------------------------------------*)
  32.  
  33. FROM MuiO      IMPORT MuiTags, CustomClassPtr, AreaObject, GroupObject, CBOOLEAN;
  34. FROM Intuition IMPORT IntuitionBase, MethodID, MsgRoot;
  35. FROM System    IMPORT Regs;
  36.  
  37.  
  38. CONST
  39.   cTableGroup = "TableGroup.mcc";
  40.  
  41. TYPE
  42.   PoolHeaderPtr     = DEFERRED POINTER Exec39     .PoolHeaderPtr;
  43.  
  44.   Errors            = (none, notEnoughMemory, noSize,
  45.                objectAlreadyMember, objectNotAMember,
  46.                makeLong = $10000);
  47.   Directions        = (down, right, makeLong = $10000);
  48.   DropTypes         = (row, column, horizontal, vertical, makeLong = 31);
  49.   DropTypeSet       = SET OF DropTypes;   | default DragDrop calls TableReplace
  50.  
  51.   TableGroupTags = TAGS OF MuiTags
  52.     tableCellHorizWeight   = $F9F8010F : LONGCARD;          |  V1 isg    horizontal weight of the current (empty) cell
  53.     tableCellVertWeight    = $F9F8010E : LONGCARD;          |  V1 isg    vertical weight of the current (empty) cell
  54.     tableColumn            = $F9F80101 : LONGCARD;          |  V1 isg    place next child in this column or ask for the column an object was dropped on
  55.     tableColumns           = $F9F8010C : LONGCARD;          |  V1 i.g    number of columns to be reserved
  56.     tableColumnSpace       = $F9F80109 : LONGCARD;          |  V1 isg    keep n characters of current font distance to the right column; if integer numbers aren't enough, denominator tags could be added in future
  57.     tableColumnSpan        = $F9F80103 : LONGCARD;          |  V1 isg    use space of the next n cells down from here for the next child
  58.     tableColumnWeight      = $F9F80113 : LONGCARD;          |  V1 i.g    horizontal weight of the current column
  59.     tableDropType          = $F9F80108 : DropTypeSet;       |  V1 isg    specify possible drop positions (horizontal, vertical for between cells; column, row for cells itself) or ask where an object was dropped
  60.     tableEmptyCells        = $F9F8010D : LONGCARD;          |  V1 is.    insert n empty cells
  61.     tableError             = $F9F80114 : Errors;            |  V1 ..g    find out the error which occurs since last question
  62.     tableFind              = $F9F80117 : AreaObject;        |  V1 is.    find the cell the object is in
  63.     tableGrowsTo           = $F9F80107 : Directions;        |  V1 isg    direction in which the table will be extended if necessary; implies the placing order: down means placing from left to right and from top to bottom
  64.     tableNextColumn        = $F9F80111 : LONGCARD;          |  V1 is.    place next child in this column, do not replace anything but extend table if necessary
  65.     tableNextRow           = $F9F80110 : LONGCARD;          |  V1 is.    place next child in this row, do not replace anything but extend table if necessary
  66.     tablePool              = $F9F80104 : PoolHeaderPtr;     |  V1 i.g
  67.     tablePoolPuddleSize    = $F9F80105 : LONGCARD;          |  V1 i..
  68.     tablePoolThreshSize    = $F9F80106 : LONGCARD;          |  V1 i..
  69.     tableRow               = $F9F80100 : LONGCARD;          |  V1 isg    place next child in this row or ask for the row an object was dropped on
  70.     tableRows              = $F9F8010B : LONGCARD;          |  V1 i.g    number of rows to be reserved
  71.     tableRowSpace          = $F9F8010A : LONGCARD;          |  V1 isg    keep n characters of current font distance to the row below; if integer numbers aren't enough, denominator tags could be added in future
  72.     tableRowSpan           = $F9F80102 : LONGCARD;          |  V1 isg    use space of the next n cells right from here for the next child
  73.     tableRowWeight         = $F9F80112 : LONGCARD;          |  V1 i.g    vertical weight of the current column
  74.     tableSkipColumns       = $F9F80116 : LONGINT;           |  V1 is.    skip n columns (n maybe < 0) and make it the current
  75.     tableSkipRows          = $F9F80115 : LONGINT;           |  V1 is.    skip n rows (n maybe < 0) and make it the current
  76.   END;
  77.  
  78.   TableGroupTagAPtr = POINTER TO TableGroupTagA;
  79.   TableGroupTagA    = ARRAY OF TableGroupTags;
  80.   | all tags changing appearance require mInitChange/mExitChange
  81.   | do not use groupColumns, groupRows but tableColumns, tableRows
  82.   | use groupChild to add new childs or
  83.   |   to get the object placed at the current position
  84.  
  85. CONST
  86.   mTableClear        = MethodID($F9F80103); | V1   clears complete table
  87.   mTableInsert       = MethodID($F9F80102); | V1   inserts new row or column, overlapping cells are stretched
  88.   mTableMove         = MethodID($F9F80104); | V1   moves a rectangular clip of objects from one table to another
  89.   mTableRemove       = MethodID($F9F80100); | V1   clears and returns object at specified position or removes a whole row or column
  90.   mTableReplace      = MethodID($F9F80101); | V1   replaces and returns object at specified position
  91.  
  92.   clearRowCurrent    = -1;
  93.   clearColumnCurrent = -1;
  94.   clearRowsAll       = -1;
  95.   clearColumnsAll    = -1;
  96.   moveRowCurrent     = -1;
  97.   moveColumnCurrent  = -1;
  98.   moveRowsAll        = -1;
  99.   moveColumnsAll     = -1;
  100.   insertCurrent      = -1;
  101.   removeCurrent      = -1;
  102.   removeAll          = -1;
  103.  
  104. TYPE
  105.   InsertDirections   = (row, column, makeLong = $10000);
  106.  
  107.   pTableClearPtr     = POINTER TO pTableClear;
  108.   pTableClear        = RECORD OF MsgRoot;
  109.              row,  column,
  110.              rows, columns : LONGINT;
  111.                END;
  112.  
  113.   pTableInsertPtr    = POINTER TO pTableInsert;
  114.   pTableInsert       = RECORD OF MsgRoot;
  115.              pos, num : LONGINT;
  116.              dir      : InsertDirections;
  117.                END;
  118.  
  119.   pTableMovePtr      = POINTER TO pTableMove;
  120.   pTableMove         = RECORD OF MsgRoot;
  121.              source  : GroupObject;
  122.              dstRow, dstColumn,
  123.              srcRow, srcColumn,
  124.              rows,   columns : LONGINT;
  125.                END;
  126.  
  127.   pTableRemovePtr    = POINTER TO pTableRemove;
  128.   pTableRemove       = RECORD OF pTableInsert END;
  129.  
  130.   pTableReplacePtr   = POINTER TO pTableReplace;
  131.   pTableReplace      = RECORD OF MsgRoot;
  132.              obj         : AreaObject;
  133.              row, column : LONGCARD;
  134.                END;
  135.  
  136. PROCEDURE MakeTableGroupObject (tags : LIST OF TableGroupTags) : GroupObject;
  137.  
  138. | sets groupForward : false additionally
  139. PROCEDURE SetTableAttrs (object : GroupObject;
  140.              tags   : LIST OF TableGroupTags);
  141.  
  142. GROUP
  143.   ClassGrp =
  144.     MakeTableGroupObject, cTableGroup;
  145.  
  146.   TagGrp =
  147.     Errors,         Directions,
  148.     DropTypes,      DropTypeSet,
  149.     TableGroupTagA, TableGroupTagAPtr,
  150.     TableGroupTags, SetTableAttrs;
  151.  
  152.   MethodGrp =
  153.     mTableClear,    mTableInsert,
  154.     mTableMove,     mTableRemove,
  155.     mTableReplace,
  156.  
  157.     clearRowCurrent, clearColumnCurrent,
  158.     clearRowsAll,    clearColumnsAll,
  159.     moveRowCurrent,  moveColumnCurrent,
  160.     moveRowsAll,     moveColumnsAll,
  161.     insertCurrent,
  162.     removeCurrent,   removeAll,
  163.  
  164.     InsertDirections,
  165.     pTableClearPtr,   pTableClear,
  166.     pTableInsertPtr,  pTableInsert,
  167.     pTableMovePtr,    pTableMove,
  168.     pTableRemovePtr,  pTableRemove,
  169.     pTableReplacePtr, pTableReplace;
  170.  
  171.   All = ClassGrp, TagGrp, MethodGrp;
  172.  
  173. END MCCTableGroup.
  174.